<include file="../header" />
<body class="J_scroll_fixed">
    <script type="text/javascript">
    $(function() {

        $('button.editStaff').click(function () {
            var mobile = $("input[name=mobile]").val()
            var staffNumber = $("input[name=staffNumber]").val()
            var staffName = $("input[name=staffName]").val()

            if(staffNumber==''||staffNumber==null){
                layer.msg('员工编号不能为空!');
                return false;
            }
             if(staffName==''||staffName==null){
                layer.msg('员工姓名不能为空!');
                return false;
            }
            //验证手机号格式
            if(!mobileValidate($.trim(mobile))) {             
                return false;
            }else{
                    $("#editForm").submit();
                }
            });

    });
</script>
	<div class="wrap jj">
		<div class="common-form">
			<form id="editForm" method="post" class="form-horizontal J_ajaxForm" action="{:U('CompanyStaff/edit_post')}">
				<input type='hidden' name='id' value='{$staff.staff_id}'/>
                                <fieldset>
                                    <div class="control-group">
                                        <label class="control-label">员工号：</label>
                                        <div class="controls">
                                            <input id='staffNumber' type="text" class="input" name="staffNumber" value="{$staff.staff_number}" readOnly='true'>
                                        </div>                                               
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">员工名称：</label>
                                        <div class="controls">
                                            <input id='staffName' type="text" class="input" name="staffName" value="{$staff.staff_name}">    
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">性别:</label>
                                        <div class="controls">
                                            {:getEnumSelectWidget($gender,'gender',$staff['gender'])}
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">手机号：</label>
                                        <div class="controls">
                                            <input id='mobile' type="text" class="input" name="mobile" value="{$staff.mobile}">    
                                        </div>
                                    </div>

				</fieldset>
				<div class="form-actions">
                                    <button  class="editStaff btn btn-primary">更新</button>
                                    <a class="btn" href="__URL__">返回</a>
				</div>
			</form>
		</div>
	</div>
	<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>